<!--
 * @message: 系统参数管理模块组件
-->
<template>
  <div>
    <Form inline :label-colon="true" class="search-form" :label-width="100">
      <FormItem label="参数类型编号">
        <Input v-model="params.parameterGroup" style="width:160px" placeholder="请输入参数类型编号"/>
      </FormItem> <FormItem label="参数名称">
      <Input v-model="params.parameterName" style="width:160px" placeholder="请输入参数名称"/>
    </FormItem> <FormItem label="参数编号">
      <Input v-model="params.parameterCode" style="width:160px" placeholder="请输入参数编号"/>
    </FormItem>
      <FormItem :label-width="0">
        <Button
          type="primary"
          @click="publicGetData()"
          v-auth="'列表'"
          style="margin-right: 10px"
        >搜索
        </Button>
        <Button type="primary" @click="publicUpdateData" v-auth="'新增'">新增</Button>
      </FormItem>
    </Form>
    <Breadcrumb></Breadcrumb>
    <BaseTable
      ref="baseTable"
      :action="action.readParameter"
      :columns="columns"
      :menu-code="menuCode"
      :public-btn="['delete', 'update']"
      @handleRemove="publicRemoveData"
      @handleUpdate="publicUpdateData"
    />
    <Drawer
      :title="viewParams.title"
      v-model="viewParams.flag"
      :width="35"
      draggable
      @on-visible-change="publicVisibleChange"
    >
      <ParameterManageUpdate
        :type="type"
        @closeView="publicCloseView"
        :key="isRefreshView"
        :idName="idName"
        :moduleId="id"/>
    </Drawer>
  </div>
</template>

<script>
import API_KEY from '../../../api'
import { tableMixin } from '../../../mixin'
import columns from './parameter-columns'
export default {
  name: 'ParameterManage',
  mixins: [tableMixin],
  data () {
    return {
      params: {
        parameterName: '',
        parameterGroup: '',
        parameterCode: ''
      },
      action: {
        readParameter: API_KEY.parameter.readParameter,
        removeDataByKey: API_KEY.parameter.curdParameter
      },
      menuCode: 'system-parameter',
      columns,
      idName: 'id',
      id: '',
      // 弹出视图标题的后缀
      suffix: '系统参数'
    }
  },
  components: {
    ParameterManageUpdate: () => import('./ParameterManageUpdate')
  }
}
</script>

<style scoped>

</style>
